package com.ntschy.bt.entity.enums;


import com.baomidou.mybatisplus.annotation.EnumValue;
import com.baomidou.mybatisplus.core.enums.IEnum;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonValue;

/**
 * @author lxr
 *
 * 状态枚举类
 */
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum  BtHelpStatusEnum implements IEnum<Integer> {

    /**
     * "1:待提交  2 ：待分配  3：待分配审核  4：待回复  5：待录入  6:已完成"
     */
    TO_SUBMIT(1,"待提交"),
    TO_BE_ASSIGNED(2,"待分配"),
    PENDING_REVIEW(3,"待分配审核"),
    TO_REPLY(4,"待回复"),
    TO_BE_ENTERED(5,"待录入"),
    COMPLETED(6, "已完成");

//    @JsonValue
    private final int value;

//    @JsonValue
    private final String desc;

    BtHelpStatusEnum(int value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    @Override
    public Integer getValue() {
        return this.value;
    }

    public String getDesc() {
        return desc;
    }

    @JsonCreator
    public static BtHelpStatusEnum getBtHelpStatusFromValue(int value) {
        for (BtHelpStatusEnum companyType : BtHelpStatusEnum.values()) {
            if(companyType.getValue() == value) {
                return companyType;
            }
        }
        return null;
    }
}
